import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/geography/exchange/getList',
    method: 'post',
    data: query
  })
}

export function fetchExchangeAvailableList(query) {
  return request({
    url: '/geography/exchange/getAvailable',
    method: 'post',
    data: query
  })
}

export function fetchArticle(id) {
  return request({
    url: '/geography/exchange/getInfo',
    method: 'post',
    data: { id }
  })
}

export function removeExchangeByID(exchangeID) {
  return request({
    url: '/geography/category/delete',
    method: 'post',
    data: {
      'exchange_identity': exchangeID
    }
  })
}

export function createArticle(data) {
  return request({
    url: '/geography/exchange/save',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: '/geography/exchange/save',
    method: 'post',
    data
  })
}
